package abstractEntities;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import org.hibernate.annotations.GenericGenerator;

import entities.User;

/**
 * AbstractCharater entity provides the base persistence definition of the
 * Charater entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractCharater implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1127767445183350119L;
	private Integer idCharacter;
	private User user;
	private String characterName;
	private Integer gameTime;
	private Integer lastxx;
	private Integer lastyy;
	private String lastMap;
	private Integer idSkin;

	// Constructors

	/** default constructor */
	public AbstractCharater() {
	}

	/** minimal constructor */
	public AbstractCharater(User user, String characterName, Integer gameTime,
			Integer idSkin) {
		this.user = user;
		this.characterName = characterName;
		this.gameTime = gameTime;
		this.idSkin = idSkin;
	}

	/** full constructor */
	public AbstractCharater(User user, String characterName, Integer gameTime,
			Integer lastxx, Integer lastyy, String lastMap, Integer idSkin) {
		this.user = user;
		this.characterName = characterName;
		this.gameTime = gameTime;
		this.lastxx = lastxx;
		this.lastyy = lastyy;
		this.lastMap = lastMap;
		this.idSkin = idSkin;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "idCharacter", unique = true, nullable = false)
	public Integer getIdCharacter() {
		return this.idCharacter;
	}

	public void setIdCharacter(Integer idCharacter) {
		this.idCharacter = idCharacter;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUser", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "characterName", nullable = false)
	public String getCharacterName() {
		return this.characterName;
	}

	public void setCharacterName(String characterName) {
		this.characterName = characterName;
	}

	@Column(name = "gameTime", nullable = false)
	public Integer getGameTime() {
		return this.gameTime;
	}

	public void setGameTime(Integer gameTime) {
		this.gameTime = gameTime;
	}

	@Column(name = "lastxx")
	public Integer getLastxx() {
		return this.lastxx;
	}

	public void setLastxx(Integer lastxx) {
		this.lastxx = lastxx;
	}

	@Column(name = "lastyy")
	public Integer getLastyy() {
		return this.lastyy;
	}

	public void setLastyy(Integer lastyy) {
		this.lastyy = lastyy;
	}

	@Column(name = "lastMap", length = 25)
	public String getLastMap() {
		return this.lastMap;
	}

	public void setLastMap(String lastMap) {
		this.lastMap = lastMap;
	}

	@Column(name = "idSkin", nullable = false)
	public Integer getIdSkin() {
		return this.idSkin;
	}

	public void setIdSkin(Integer idSkin) {
		this.idSkin = idSkin;
	}

}